home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2065 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: mail2news.demon.co.uk!hpl3sn03.cern.ch
  2. From: Dan Pop <danpop@mail.cern.ch>
  3. Newsgroups: comp.unix.osf.osf1,comp.lang.c
  4. Subject: Re: printf-problem
  5. Date: Thu, 18 Jan 1996 21:18:56 +0100
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <9601182018.AA15332@dxmint.cern.ch>
  8. References: <4dj4g6$t9f@sunsystem5.informatik.tu-muenchen.de> <821915961snz@genesis.demon.co.uk> <DLDs8G.JJ9@cwi.nl>
  9. X-NNTP-Posting-Host: hpl3sn03.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11. X-Mail2News-Path: dxmint.cern.ch!hpl3sn03.cern.ch
  12.  
  13. dik@cwi.nl (Dik T. Winter) writes:
  14.  
  15. >In article <821915961snz@genesis.demon.co.uk> fred@genesis.demon.co.uk writes:
  16. > > In article <4dj4g6$t9f@sunsystem5.informatik.tu-muenchen.de>
  17. > >            wist@lam.mw.tu-muenchen.de "Henrik Wist" writes:
  18. > > >long int zahl;   /* which is e.g. 10000500001 */
  19. > > >printf("%d\n",zahl);      /* gives 1410565409, which is definitly wrong */
  20. > > >.
  21. > > >
  22. > > >Is that a problem of printf() or DG-UX or is it my problem that I don't know
  23. > > >the right conversion for printf(). Btw, printf("%u",zahl) didn't work either.
  24. > > RTFM. 'man printf' will almost certainly tell you that the conversion
  25. > > specifier for longs is %ld.
  26. >
  27. >Alas, the FM will not tell him that the value is too large and does not
  28. >fit in the variable zahl, so only the lower 32 bits are retained.
  29.  
  30. Huh???
  31.  
  32. The Newsgroups line strongly suggests that he was using a DEC OSF/1
  33. system and 10000500001 fits quite well in 64 bits (the size of long int
  34. on that platform).
  35.  
  36. Dan
  37. -- 
  38. Dan Pop
  39. CERN, CN Division
  40. Email: danpop@mail.cern.ch 
  41. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  42.